<?php

class Flexical_Model_Object
{
	public $id = -1;

	public $title = '';

	public function __construct()
	{
		$this->id = -1;
		$this->title = '';
	}

	public static function compare_by_title( $a, $b )
	{
		$al = strtolower( $a->title );
		$bl = strtolower( $b->title );

		if ( $al == $bl )
		{
			return 0;
		}

		else
		{
			return $al < $bl ? -1 : 1;
		}
	}

	public static function compare_by_id( $a, $b )
	{
		if ( $a->id == $b->id )
		{
			return 0;
		}

		else
		{
			return $a->id < $b->id ? -1 : 1;
		}
	}
}

?>
